package com.ftg.learn.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ftg.learn.system.entity.User;
import com.ftg.learn.system.mapper.UserMapper;
import com.ftg.learn.system.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author kangjx
 * @since 2023-09-20
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {


    @Override
    public Integer showAllBySelf(List<Integer> id) {

        /**
         * 是不是要知识主键
         */
        QueryWrapper<User> query = new QueryWrapper<>();
        query.lambda().eq(User::getId,id.get(0));
        return getBaseMapper().delete(query);
    }
}
